import { createSlice, type PayloadAction } from "@reduxjs/toolkit";

interface ServerState {
    isConnect: boolean;
}

const initialState: ServerState = {
    isConnect:false
}

const serverStore = createSlice({
    name: "server",
    initialState,
    reducers: {
        setIsConnect: (state, action: PayloadAction<boolean>) => {
            state.isConnect = action.payload
        },
    },
});


const serverReducer = serverStore.reducer

export const {setIsConnect} = serverStore.actions
export default serverReducer;